import {dataPostRequest, dataPutRequest, deleteRequest, getRequest} from "../../../utils/request";

/**
 * 查询用户信息
 * @param {*} url 接口路径
 * @returns  用户信息
 */
export const listConsumer = () => {
    return getRequest("/consumer/consumerRouterList");
};


/**
 * 条件查询用户信息
 * @param param
 */
export const listConsumerByCondition = (param) => {
    return getRequest('/consumer/listConsumerByCondition', param);
};


/**
 * 新增用户
 * @param data 用户信息
 * @returns {AxiosPromise}
 */
export const saveConsumer = (data) => {
    return dataPostRequest('/consumer/saveConsumer', data);
}

/**
 * 修改用户
 * @param data 用户信息
 * @returns {AxiosPromise}
 */
export const updateConsumer = (data) => {
    return dataPutRequest('/consumer/updateConsumer', data);
}


/**
 * 删除用户
 * @param id 用户id
 * @returns {AxiosPromise}
 */
export const deleteConsumerById = (id) => {
    return deleteRequest('/consumer/deleteConsumer/' +id);
}

